function [sl,sr] = GetOptShift( pnum )
    global Opt;
    global DifDev;
    Wp = load('workparams.mat');

    t = deval(Opt.optsol0, 10000);
    coldif0 = DifDev.dif0(pnum,:);
    shift0 = abs(t(1)*0.333 / coldif0(1));    
    shift15 = 0.27 / DifDev.dev15log10(pnum);
    shift75 = 0.27 / DifDev.dev75log10(pnum);
    shift150 = 0.27 / DifDev.dev150log10(pnum);
    
    sr = min([shift0 shift15 shift75 shift150]) / 5;
    
    k = keys(Wp.pdm);
    pinfo = Wp.pdm(cell2mat(k(pnum)));      
    
    lb = pinfo(2);
    efflb = lb;
    
    defVal = pinfo(1);   
    if abs(defVal) < 10*eps
        sl = 0;
    else
        if lb > 0
            efflb = 0;
        end
        sl = min(sr, (defVal - efflb) / 2);   
    end
end

